home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Author: Markus van Kempen
- ** Date : 18. Dezember 1992
- **
- **/
-
-
-
- BOOL HandleEvents(struct EI_Window *Window)
- {
- BOOL raus = FALSE; /* TRUE, wenn die Funktion verlassen werden soll */
- ULONG GetBits,WaitBits; /* MessagePort-Bits */
- EI_EIntuiMsgPtr imess; /* Message-Struktur-Pointer */
- ER_FileRequestPtr freq;
- int id;
-
- freq = ER_CreateFileReq(NULL);
-
- WaitBits = (1L << Window->UserPort->mp_SigBit) | SIGBREAKF_CTRL_C;
-
- while (!raus)
- {
- GetBits = Wait(WaitBits);
-
- if (GetBits & SIGBREAKF_CTRL_C) /* CTRL-D gedrückt */
- {
- raus = TRUE;
- }
-
- while ((imess = (struct EI_EIntuiMsg *)GetMsg(Window->UserPort)) != NULL)
- {
-
- switch (imess->Class)
- {
-
- case EI_iGADGETUP:
- printf("Gadget \n");
- id = ((struct EI_Gadget *)imess->IAddress)->GadgetID;
- ReplyMsg((struct Message *)imess);
- printf("id = %4lx \n", id);
- EI_SleepWindow(Window);
-
- switch (id)
- { /* Record */
- case 0x1000:
- printf("Recording\n");
- myMSG(" | Recording | STOP ? | ");
- break;
-
- /* Play */
- case 0x1001:
- myMSG(" | Ready with playing data ! | ");
- break;
-
- /* Load */
- case 0x1002:
-
- dummy = ER_DoRequest((ER_RequestPtr)freq);
-
- /*
- if (freq->Name != NULL)
- myLoad(freq->Name,freq->Path);
- */
-
- break;
-
- /* Save */
- case 0x1003:
-
- dummy = ER_DoRequest((ER_RequestPtr)freq);
- /*
-
- if (freq->Name != NULL)
- mySave(freq->Name,freq->Path);
- */
- break;
- case 0x1100:
- break;
- }
- EI_WakeWindow(Window);
-
- break;
-
- case EI_iCLOSEWINDOW:
-
- printf("iClose\n");
- raus = TRUE;
-
- ReplyMsg ((struct Message *)imess);
- break;
-
- case EI_iMENUPICK:
-
- printf("iMenu\n");
- printf("Code = %lx\n",imess->Code);
- /*
-
- switch(imess->Code)
- {
-
- }
-
-
- */
- ReplyMsg ( (struct Message *)imess );
- break;
-
- case EI_iSIZEVERIFY:
- printf("VerifySizing ! \n");
-
- EI_RemoveGList(Window,con->First,con->Num);
-
- EB_DeleteGadContext(con);
- ReplyMsg ( (struct Message*)imess );
- break;
-
- case EI_iNEWSIZE:
- printf("Sizing ! \n");
- EI_LockIntuition();
-
- Window=(struct EI_Window *)CreateGads((EI_WindowPtr)Window);
- EI_AddGList(Window,con->First,con->Num);
-
- EI_UnlockIntuition();
- ReplyMsg ( (struct Message*)imess );
- break;
-
-
- default:
- printf (" Unknown message %ld & %d\n ",imess->Class,imess->Code);
- ReplyMsg((struct Message *)imess);
-
- }
- }
- }
-
- ER_DeleteRequest((ER_RequestPtr)freq);
- return raus;
- }
-
-